package com.mahjong.server.component.logic.handler;

import com.mahjong.server.common.Common;
import com.mahjong.server.mina.protocol.DataBuf;
import com.mahjong.server.mina.protocol.MessageProtocol;

/**
 * 
 * @author yougang
 * @date 2013-3-5 上午10:59:26
 * @Description 麻将响应
 */
public class CreatePaiResp extends MessageProtocol {

  private static final byte TAG=Common.Resp;

  private static final short PROTOCOL_NUM=0x0102;

  private String[] pais;

  public CreatePaiResp() {
    setTag(TAG);
    setProtocolNum(PROTOCOL_NUM);
  }

  public CreatePaiResp(String[] pais) {
    this();
    this.pais=pais;
  }

  @Override
  public void respEncode(DataBuf buf) {
	  String paiStr = "";
      for (String pai : pais) {
    	  paiStr+=pai+",";
	  }
      buf.putString(paiStr.substring(0,paiStr.length()-1));
      System.out.println("发牌数据："+paiStr.substring(0,paiStr.length()-1));
  }
}
